import md5 from '@/util/md5';

export default [
  {
    name: '柱状图',
    children: [
      {
        id: md5.hex_md5('datav-built-in-chart-BarChart'),
        name: '基础柱状图',
        selector: 'datav-built-in-chart',
        type: 'BarChart',
        icon: 'icon-fsux_tubiao_zhifangtu',
        loadData: true,
        options: [
          {
            name: '横向坐标轴',
            code: 'xAxis',
            children: [
              {
                name: '显示',
                code: 'xAxis.show',
                default: true,
                type: 'boolean'
              },
              {
                name: '类型',
                code: 'xAxis.type',
                selectList: [
                  {name: '类目轴' , value: 'category'},
                  {name: '数值轴' , value: 'value'}
                ],
                default: 'category',
                type: 'select'
              },
              {
                name: '刻度最小值',
                code: 'xAxis.min',
                default: null,
                type: 'number',
                show: [
                  {
                    code: 'xAxis.type',
                    value: 'value'
                  }
                ]
              },
              {
                name: '刻度最大值',
                code: 'xAxis.max',
                default: null,
                type: 'number',
                show: [
                  {
                    code: 'xAxis.type',
                    value: 'value'
                  }
                ]
              }
            ]
          },
          {
            name: '纵向坐标轴',
            code: 'yAxis',
            children: [
              {
                name: '显示',
                code: 'yAxis.show',
                default: true,
                type: 'boolean'
              },
              {
                name: '类型',
                code: 'yAxis.type',
                selectList: [
                  {name: '类目轴' , value: 'category'},
                  {name: '数值轴' , value: 'value'}
                ],
                default: 'value',
                type: 'select'
              },
              {
                name: '刻度最小值',
                code: 'yAxis.min',
                default: null,
                type: 'number',
                displayCondition: [
                  {
                    code: 'yAxis.type',
                    value: 'value'
                  }
                ]
              },
              {
                name: '刻度最大值',
                code: 'yAxis.max',
                default: null,
                type: 'number',
                displayCondition: [
                  {
                    code: 'yAxis.type',
                    value: 'value'
                  }
                ]
              }
            ]
          }
        ],
        dataset: [
          {
            name: '',
            specs: [
              {
                name: '类别',
                code: 'category',
                type: 'field'
              },
              {
                name: '值',
                code: 'value',
                type: 'field'
              }
            ]
          }
        ]
      }
    ]
  }
]